<link href="<?=base_url();?>required/css/datepicker.css" rel="stylesheet" type="text/css">
<link href="<?=base_url();?>required/css/clockpick.css" rel="stylesheet" type="text/css">
<link href="<?=base_url();?>required/css/jquery_accordion.css" rel="stylesheet" type="text/css">
<link href="<?=base_url();?>required/css/flora_tabs.css" rel="stylesheet" type="text/css">
<div id="post">

<?php
$attributes = array('class' => 'postcontent', 'id' => 'postcontent');
			 
			
//			date('Y-m-d H:i:s')echo date("2002-09-08".' H:i:s');
			
switch($this->validation->Status)
	{
		case 1: 	 $status='<option value="1" selected>Published</option>
                      <option value="2">Unpublished</option>
                      <option value="3">Draft</option>
                      <option value="4">Private</option>
                      <option value="5">Trash</option>';break;
		case 2: 	 $status='<option value="1" >Published</option>
                      <option value="2" selected>Unpublished</option>
                      <option value="3">Draft</option>
                      <option value="4">Private</option>
                      <option value="5">Trash</option>';break;
		case 3: 	 $status='<option value="1">Published</option>
                      <option value="2">Unpublished</option>
                      <option value="3" selected>Draft</option>
                      <option value="4">Private</option>
                      <option value="5">Trash</option>';break;
		case 4: 	 $status='<option value="1">Published</option>
                      <option value="2">Unpublished</option>
                      <option value="3">Draft</option>
                      <option value="4" selected>Private</option>
                      <option value="5">Trash</option>';break;
		case 5: 	 $status='<option value="1">Published</option>
                      <option value="2">Unpublished</option>
                      <option value="3">Draft</option>
                      <option value="4">Private</option>
                      <option value="5" selected>Trash</option>';break;
					  
		default: 	 $status='<option value="1" selected>Published</option>
                      <option value="2">Unpublished</option>
                      <option value="3">Draft</option>
                      <option value="4">Private</option>
                      <option value="5">Trash</option>';break;			  			  			  			  			  
	}				
			 
echo form_open('admin/CreateBlog/', $attributes);
echo "<div class=\"error\" >".$this->validation->error_string."</div>"; ?>
<div id="titlepost"><p>Blog Title</p>
  <input name="Title" type="text" id="Title" value="<?=$this->validation->Title;?>" size="50" maxlength="100" />
</div>
<br /><br />
<div id="postcontent"><p>Blog Content</p><textarea name="Content" id="Content" rows="10" cols="60" ><?=$this->validation->Content;?></textarea></div>
<br><br>
<div id="firsttabs" class="flora">
                            <ul>
                                    <li><a href="#Category"><span>Category</span></a></li>
                                    <li><a href="#BlogComments"><span>Comments</span></a></li>
                                    <!--<li><a href="#Protection"><span>Protection</span></a></li> -->
                                    <li><a href="#BlogStatus"><span>Status</span></a></li>
                                    <li><a href="#Tags"><span>Tags</span></a></li>
                                    <li><a href="#BlogAuthor"><span>Author</span></a></li>
                                    <li><a href="#Date"><span>Date</span></a></li>
                            </ul>
                            <div id="Category"><?=$cats?></div>
                            <div id="BlogComments"> 
                                      <label>Allow Comments
                                        <input name="Comments" type="checkbox" id="Comments" value="1" <?=$this->validation->set_checkbox('Comments', '1')?>  />
                                      </label>
                                      <br />
                                      <div style="display:none"><label>Allow Comment Email Notification
                                        <input name="CommentNotification" type="checkbox"  id="CommentNotification" value="1" <?=$this->validation->set_checkbox('CommentNotification', '1')?>   />   </label></div>
                                      
                             </div>
                            <!-- <div id="Protection"><br>
                                    Enter Password :
                                    <input name="PasswordProtected"  type="text" size="50" maxlength="20" id="PasswordProtected" value="<?=$this->validation->PasswordProtected;?>"/>
                                <br>
                                <br>
                              </div> -->
                              
                              <div id="BlogStatus">Status : Choose status
                                    <select name="Status" id="Status">
                                      <?=$status?>
                                    </select>
                                  </div>
                               
                               <div id="Tags">
                                    <p>Create Tag Cloud</p>
                                    <p>
                                      <textarea name="TagClouds" cols="45" rows="3" id="TagClouds"><?=$this->validation->TagClouds?></textarea>
                                    (use , to separate tags.)</p>
                                        <div id="tagList">&nbsp;</div>
                                  </div>
                                  <div id="BlogAuthor">
                                    <p>Author Name :
                                      <input type="text" name="Author" id="Author" value="<?=$this->validation->Author;?>"/>
                                    </p>
                                    <p>Author Email&nbsp;&nbsp;:
                                      <input type="text" name="AuthorEmail" id="AuthorEmail" value="<?=$this->validation->AuthorEmail;?>" />
                                    </p>
                                  </div>
                                  <div id="Date">
                                  <p>&nbsp;</p>
                                      <p>Date:&nbsp;<input type="text" name="blog_date" id="calendar1" value="<?=$this->validation->blog_date;?>" class="calendarFocus" /></p>
                                      <p>Time:<input type="text" name="blog_time" id="clockpick" value="<?=$this->validation->blog_time;?>" class="clockFocus" /></p>
                                  </div>
			    		</div><!--end of first tab-->
				</p>
			</div><!--end of first accordion -->
            
         <!-- <div id="secondtabs" class="flora">
                            <ul>
                                    <li><a href="#HTML-Meta-Tags"><span>HTML Meta Tags</span></a></li>
                                    <li><a href="#HTMLSummary"><span>Summary</span></a></li>
                                   
                            </ul>
                             <div id="HTML-Meta-Tags">
                                              
                                              <table width="376" border="0" class="TabbedPanelsContent"  style="width:500px;">
                                                  <tr>
                                                    <td width="70">Meta</td>
                                                    <td width="420"><textarea name="Meta" id="Meta" cols="45" rows="1"><?=$this->validation->Meta;?></textarea></td>
                                                  </tr>
                                                  <tr>
                                                    <td>Keywords&nbsp;</td>
                                                    <td><textarea name="Keyword" cols="45" rows="1" id="Keyword"><?=$this->validation->Keyword;?></textarea></td>
                                                  </tr>
                                                  <tr>
                                                    <td>Description&nbsp;</td>
                                                    <td><textarea name="Description" id="Description" cols="45" rows="1"><?=$this->validation->Description;?></textarea></td>
                                                  </tr>
                                                </table>
                                                                            
                            </div>
                            <div id="HTMLSummary">
                                 <textarea name="Summary" id="Summary" cols="45" rows="3"><?=$this->validation->Summary;?></textarea>
                            </div>
                    </div><!--end of second tabbs -->
				</p>
			</div><!--end of second accordion --> -->
			  
<!--<div id="PostOptions" class="Accordion" >
	<div class="AccordionPanel">
      <div class="AccordionPanelTab">More Options</div>
            <div class="AccordionPanelContent">    
              
              <div id="tabbox">
                <div id="TabbedPanels2" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">Category</li>
                  <li class="TabbedPanelsTab" tabindex="0">Comments</li>
                  <li class="TabbedPanelsTab" tabindex="0">Protection</li>
                  <li class="TabbedPanelsTab" tabindex="0">Status</li>
                  <li class="TabbedPanelsTab" tabindex="0">Tags</li>
                  <li class="TabbedPanelsTab" tabindex="0">Author</li>
                  <li class="TabbedPanelsTab" tabindex="0">Date</li>
                </ul>
                <div class="TabbedPanelsContentGroup">
                  <div class="TabbedPanelsContent">
                  
                  
                    <p>
             < ?=$cats?>
                      
                      
                    </p>
                  </div>
                  <div class="TabbedPanelsContent"> <br />
                      <label>Allow Comments
                        <input name="Comments" type="checkbox" id="Comments" value="1" < ?=$this->validation->set_checkbox('Comments', '1')?>  />
                      </label>
                      <br />
                      <label>Allow Comment Email Notification
                        <input name="Commentnotification" type="checkbox"  id="Commentnotification" value="1" < ?=$this->validation->set_checkbox('Commentnotification', '0')?>   />                      </label>
                      <br />
                      <br />
                      <br />
                  </div>
                  <div class="TabbedPanelsContent"><br>
                    Enter Password :
                    <input name="PasswordProtected"  type="text" size="50" maxlength="20" id="PasswordProtected" value="< ?=$this->validation->PasswordProtected;?>"/>
                <br>
                <br>
                  </div>
                  <div class="TabbedPanelsContent">Status : Choose status
                    <select name="Status" id="Status">
                      <option value="1" selected>Published</option>
                      <option value="2">Unpublished</option>
                      <option value="3">Draft</option>
                      <option value="4">Private</option>
                      <option value="5">Trash</option>
                    </select>
                  </div>
                  <div class="TabbedPanelsContent">
                    <p>Create Tag Cloud</p>
                    <p>
                      <textarea name="TagClouds" cols="45" rows="3" id="TagClouds"></textarea>
                    (use , to separate tags.)</p>
                        <div id="tagList">&nbsp;</div>
                  </div>
                  <div class="TabbedPanelsContent">
                    <p>Author Name :
                      <input type="text" name="Author" id="Author" value="< ?=$this->validation->Author;?>"/>
                    </p>
                    <p>Author Email&nbsp;&nbsp;:
                      <input type="text" name="AuthorEmail" id="AuthorEmail" value="< ?=$this->validation->AuthorEmail;?>" />
                    </p>
                  </div>
                  <div class="TabbedPanelsContent">
                   <p>&nbsp;</p>
                      <p>Date:&nbsp;<input type="text" name="date" id="calendar1" class="calendarFocus" /></p>
                      <p>Time:<input type="text" name="time" id="clockpick" class="clockFocus" /></p>
                  </div>
                </div>
              </div>
              </div>
            </div>
          </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">Advanced Options</div>
            <div class="AccordionPanelContent">
                
             <div id="tabbox">
              <div id="TabbedPanels1" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">HTML Meta Tags</li>
                        <li class="TabbedPanelsTab" tabindex="0">Summary</li>
                      </ul>
                      <div class="TabbedPanelsContentGroup">
                        <div class="TabbedPanelsContent">
                              
                              <table width="376" border="0" class="TabbedPanelsContent"  style="width:500px;">
                                  <tr>
                                    <td width="70">Meta</td>
                                    <td width="420"><textarea name="Meta" id="Meta" cols="45" rows="1">< ?=$this->validation->Meta;?></textarea></td>
                                  </tr>
                                  <tr>
                                    <td>Keywords&nbsp;</td>
                                    <td><textarea name="Keyword" cols="45" rows="1" id="Keyword">< ?=$this->validation->Keyword;?></textarea></td>
                                  </tr>
                                  <tr>
                                    <td>Description&nbsp;</td>
                                    <td><textarea name="Description" id="Description" cols="45" rows="1">< ?=$this->validation->Description;?>
                                    </textarea></td>
                                  </tr>
                                </table>
                                                            
   					    </div>
                           <div class="TabbedPanelsContent">
                             <label></label>
                                <br>
                            
                            <textarea name="Summary" id="Summary" cols="45" rows="3">< ?=$this->validation->Summary;?></textarea>
                        </div>
                      </div>
                </div>
              </div>
            </div>
          </div>
        </div>
<p> -->
 <!--********************************* new changes ************************** 
  <div class="basic"   id="list1a">
			<a>Blog Options</a>

			<div>
				<p>
					

			<a>Advanced Options</a>
			<div>
				<p>
					
		</div>
        
    --> 
    
     
    <!--************************************************* -->
    
    <p>&nbsp;</p>    
  <input name="post" type="submit" value="Post Blog"  class="small-button"/> &nbsp;&nbsp;&nbsp;
  <input type="reset" name="Reset" id="button" value="Reset" class="small-button" />
 <p>&nbsp;</p>
  <?=form_close()?>
</p>
</div>


<script src="<?=base_url();?>required/js/datepicker.js" type="text/javascript"></script>
<script src="<?=base_url();?>required/js/clockpick.js" type="text/javascript"></script>
<script src="<?=base_url()?>required/js/jquery-ui.js"type="text/javascript"></script>
<script type="text/javascript">
		//<![CDATA[
			$(document).ready(function (){ 
				
			//we're initialize date calendar event
			$("#calendar1").datepicker({ 
					dateFormat: "yy-mm-dd", 
					showOn: "both", 
					buttonImage: "<?=base_url()?>required/css/images/calendar.gif", 
					buttonImageOnly: true 
				}); //end of calendar
				
			//we're initialize clock event
			$("#clockpick").clockpick({
											starthour : 0,
											endhour : 23,
											military:true
									}); //end of clock
		
								
			//we're initialize first tab
			$('#firsttabs > ul').tabs({ 
										fx: { 
												opacity: "toggle" 
											} 
									 }); //end of first tab 
									 
			//we're initialize second tab
			$('#secondtabs > ul').tabs({ 
										fx: { 
												opacity: "toggle" 
											} 
						});		//end of second tab
				
			});//end of document ready
				
				//$("#calendar1, #calendar2").calendar();
				//$("#calendar1_alert").click(function(){alert(popUpCal.parseDate($('#calendar1').val()))});
		
		//]]>
</script>


<script language="javascript" type="text/javascript" src="<?=base_url()?>required/tiny/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
	// General options
	mode : "exact",
	elements : "Content",
	theme : "advanced",
	skin : "o2k7",	
	plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
	

	// Theme options
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
	theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,|,forecolor,backcolor,|,insertlayer,moveforward,movebackward,absolute,|,advhr,|,sub,sup",
	theme_advanced_buttons3 : "tablecontrols,|,charmap,iespell,media,|,print,|,fullscreenstyleprops,|,abbr,attribs,cleanup,mybutton,code",
	theme_advanced_buttons4 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : true,

	// Example content CSS (should be your site CSS)
	content_css : "css/content.css",

	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "lists/template_list.js",
	external_link_list_url : "lists/link_list.js",
	external_image_list_url : "lists/image_list.js",
	media_external_list_url : "lists/media_list.js",

	setup : function(ed) {
        // Add a custom button
        ed.addButton('mybutton', 
		{
            title : '',
            image : '<?=base_url()?>required/tiny/jscripts/tiny_mce/plugins/morebutton/img/morebutton.gif',
            onclick : function()
			 {	// Add you own code to execute something on click
                ed.selection.setContent('||more||');
             }
        });
    						}
		
	
	

});
</script>

<?php
/*
waste code

//grab date and time...
			 $month=$this->input->post('month');
			 $day=$this->input->post('day');
			 $year=$this->input->post('year');
			 $hour=$this->input->post('hour');
			 $mins=$this->input->post('minutes');
			 $seconds=$this->input->post('seconds');
			 
			 //$datestring = "Year: $year Month: $month Day: $day - %h:%i %a";
			 //$time = time();
			 //echo mdate($datestring, $time);
			 $datestr=$year."-".$month."-".$day." ".$hour.":".$mins.":".$seconds;
			 
			 echo date($datestr);

*/?>